home *** CD-ROM | disk | FTP | other *** search
- Path: news.Stanford.EDU!usenet
- From: Nick Cassimatis <nick@psych.stanford.edu>
- Newsgroups: comp.lang.c++
- Subject: Default Constructors
- Date: Fri, 12 Apr 1996 21:20:24 -0700
- Organization: Stanford University
- Message-ID: <316F2B88.5FC4@psych.stanford.edu>
- NNTP-Posting-Host: nick.stanford.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win95; I)
-
- I'm having trouble getting default constructors to work in another
- class' constructor: e.g.,
-
- class position {
- int x,y,z;
- position() {x = y = z = 0;};
- position(int, int, int);
- };
-
- class object {
- position pos;
- object();
- };
-
- object::object() {
- pos.x = 1;
- }
-
- I get the following error messages (in BC4.5):
-
- 'position::position()' is not accessible in function object::object()
- 'position::x' is not accessible in function object::object()
-
- What exactly is meant by "access"? And why wouldn't I have it to an
- object that's already been declared?
-
- -Nick
-